package adfc2.entities;

import adfc2.core.Entity;
import adfc2.core.Item;

public class DroppedItem extends Entity {

    public final Item item;

    public DroppedItem(Item item) {
        assert item.owner == null;
        this.item = item;
        item.owner = this;
    }

    @Override
    public String toString() {
        return "DroppedItem" + "@" + getX() + "," + getY() + "[" + item + "]";
    }

    @Override
    public String shortName() {
        return item.shortName();
    }

    @Override
    public void removed() {
        assert item.owner == this;
        item.owner = null;
    }
}
